import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../components/home/top.vue";
import list from "../pages/list.vue";
import list2 from "../pages/list2.vue";
//import Detail from "../pages/Detail.vue"
Vue.use(VueRouter);

const routes = [
  {
    path: "/home",
    name: "Home",
    component: Home,
  },
  {
    path: "/list",
    component: list,
    children: [//数组里面存储都是相同的结构
      {
        path: 'detail',//不需要加 /
        //component:Detail
        component:()=>import('../pages/Detail.vue')
      },
      // {
      //   path: '/',
      //   component:''
      // },
      // {
      //   path: '/',
      //   component:''
      // }
    ]

  },
  {
    path: "/list2",
    component: list2
  },

];

const router = new VueRouter({
  routes,
});

export default router;